/*
 Navicat MySQL Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50723
 Source Host           : localhost:3306
 Source Schema         : auto_code

 Target Server Type    : MySQL
 Target Server Version : 50723
 File Encoding         : 65001

 Date: 27/10/2018 21:01:50
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for back_user
-- ----------------------------
DROP TABLE IF EXISTS `back_user`;
CREATE TABLE `back_user` (
  `username` varchar(20) NOT NULL COMMENT '用户名',
  `password` varchar(50) NOT NULL COMMENT '密码',
  `add_time` datetime NOT NULL COMMENT '添加时间',
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of back_user
-- ----------------------------
BEGIN;
INSERT INTO `back_user` VALUES ('aaaa', '123456', '2015-01-05 11:52:26');
INSERT INTO `back_user` VALUES ('admin', 'admin', '2014-06-24 10:12:49');
COMMIT;

-- ----------------------------
-- Table structure for banner_manager
-- ----------------------------
DROP TABLE IF EXISTS `banner_manager`;
CREATE TABLE `banner_manager` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `system_code` varchar(45) NOT NULL COMMENT '系统code',
  `banner_type` int(11) NOT NULL COMMENT '类型',
  `banner_value` varchar(45) NOT NULL COMMENT '配置值',
  `is_enable` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启',
  `is_delete` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `system_code_UNIQUE` (`system_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for datasource_config
-- ----------------------------
DROP TABLE IF EXISTS `datasource_config`;
CREATE TABLE `datasource_config` (
  `dc_id` int(11) NOT NULL AUTO_INCREMENT,
  `driver_class` varchar(50) DEFAULT NULL COMMENT '数据库驱动',
  `db_name` varchar(50) DEFAULT NULL,
  `ip` varchar(50) DEFAULT NULL,
  `port` int(11) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `back_user` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`dc_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of datasource_config
-- ----------------------------
BEGIN;
INSERT INTO `datasource_config` VALUES (4, 'com.mysql.jdbc.Driver', 'auto_code', 'localhost', 3306, 'root', 'root', 'admin');
INSERT INTO `datasource_config` VALUES (6, 'com.mysql.jdbc.Driver', 'rms', 'localhost', 3306, 'root', 'root', 'admin');
INSERT INTO `datasource_config` VALUES (9, 'com.mysql.jdbc.Driver', 'stu', 'localhost', 3306, 'root', 'root', 'admin');
INSERT INTO `datasource_config` VALUES (11, 'com.mysql.jdbc.Driver', 'ymm', '127.0.0.1', 3306, 'root', 'root', 'admin');
INSERT INTO `datasource_config` VALUES (12, 'com.mysql.jdbc.Driver', 'vback', '127.0.0.1', 3306, 'root', 'root', 'admin');
INSERT INTO `datasource_config` VALUES (13, 'com.mysql.jdbc.Driver', 'cmdb_config', '127.0.0.1', 3306, 'root', '111111', 'admin');
COMMIT;

-- ----------------------------
-- Table structure for message_app
-- ----------------------------
DROP TABLE IF EXISTS `message_app`;
CREATE TABLE `message_app` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `app_name` varchar(45) NOT NULL COMMENT '项目名称，例如：分子贷',
  `app_key` varchar(45) NOT NULL COMMENT 'App唯一标识',
  `id_delete` tinyint(1) NOT NULL COMMENT '是否删除',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for template_config
-- ----------------------------
DROP TABLE IF EXISTS `template_config`;
CREATE TABLE `template_config` (
  `tc_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `save_path` varchar(100) DEFAULT NULL,
  `suffix` varchar(20) DEFAULT NULL,
  `file_name` varchar(1000) DEFAULT NULL,
  `content` text,
  `back_user` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`tc_id`),
  KEY `f_backuser` (`back_user`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8 COMMENT='模板表';

-- ----------------------------
-- Records of template_config
-- ----------------------------
BEGIN;
INSERT INTO `template_config` VALUES (10, 'durc_Service_gai', 'service', 'java', '${context.javaBeanName}Service.java', 'package ${context.packageName}.service;\n\nimport ${context.packageName}.domain.${context.javaBeanName};\n\npublic interface ${context.javaBeanName}Service {\n    int deleteByPrimaryKey(${context.javaPkType} ${context.javaPkName});\n\n    int insert(${context.javaBeanName} record);\n\n    int insertSelective(${context.javaBeanName} record);\n\n    ShakeDevice selectByPrimaryKey(${context.javaPkType} ${context.javaPkName});\n\n    int updateByPrimaryKeySelective(${context.javaBeanName} record);\n\n    int updateByPrimaryKey(${context.javaBeanName} record);\n}', '1');
INSERT INTO `template_config` VALUES (14, 'durc_Controller', 'controller', 'java', '${context.javaBeanName}Controller.java', 'package ${context.packageName}.controller;\n\nimport org.durcframework.core.GridResult;\nimport org.durcframework.core.MessageResult;\nimport org.durcframework.core.controller.CrudController;\nimport ${context.packageName}.entity.${context.javaBeanName};\nimport ${context.packageName}.entity.${context.javaBeanName}Sch;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\n@Controller\npublic class ${context.javaBeanName}Controller extends\n		CrudController<${context.javaBeanName}, ${context.javaBeanName}Service> {\n\n	@RequestMapping(\"/add${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult add${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.save(entity);\n	}\n\n	@RequestMapping(\"/list${context.javaBeanName}.do\")\n	public @ResponseBody\n	GridResult list${context.javaBeanName}(${context.javaBeanName}Sch searchEntity) {\n		return this.query(searchEntity);\n	}\n\n	@RequestMapping(\"/update${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult update${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.update(entity);\n	}\n\n	@RequestMapping(\"/del${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult del${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.delete(entity);\n	}\n	\n}', '1');
INSERT INTO `template_config` VALUES (15, 'sw-mybatis-sqlserver', '${context.javaBeanNameLF}/mapper', 'xml', '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao\">\n<resultMap id=\"BaseResultMap\" type=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n#foreach($column in $columns)\n    <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\"/>\n#end	\n</resultMap>\n	<select id=\"query\" resultMap=\"BaseResultMap\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" >\n		<if test=\"paramMap.rp>0\">\n			SELECT t0.* FROM (\n		</if>\n		select row_number() over(order by\n		<choose>\n			<when test=\"paramMap.orderCol!=null\">\n				${paramMap.orderCol}\n			</when>\n			<otherwise>\n				${context.pkName} desc\n			</otherwise>\n		</choose>\n		) row\n                #set ($i=0) \n        #foreach($column in $columns)                          \n                #if($i > 0),#end ${column.columnName}\n                  #set($i=$i +1)                  \n        #end\n		from ${table.tableName} t \n		<include refid=\"conditionQuery.core\" />\n 		<if test=\"paramMap.rp > 0\">\n			) t0 WHERE t0.row BETWEEN (#{paramMap.firstResult} +1) AND\n			(#{paramMap.firstResult}  \n			#{paramMap.rp})\n		</if>\n	</select>\n	<select id=\"get\" resultMap=\"BaseResultMap\" parameterType=\"java.lang.Integer\" >\n   SELECT \n#set ($i=0) \n        #foreach($column in $columns)                          \n                #if($i > 0),#end \n                ${column.columnName}\n                  #set($i=$i +1)                  \n        #end\n        FROM ${table.tableName}\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n	 </select>\n	<delete id=\"delete\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" >\n       DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n	</delete>\n	<insert id=\"save\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" useGeneratedKeys=\"true\" keyProperty=\"${context.javaPkName}\">\n		INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end ${column.columnName}\n               #set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n        #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n               #set($i=$i +1)\n            #end          \n        #end\n \n        )\n	</insert>\n	<select id=\"queryCnt\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" resultType=\"java.lang.Integer\" >\n		select count(*) from ${table.tableName} t\n		<include refid=\"conditionQuery.core\" />\n	</select>\n\n    <update id=\"update\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk})               \n        #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n               #set($i=$i +1)\n            #end          \n        #end    \n    WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n</mapper>', '1');
INSERT INTO `template_config` VALUES (16, 'sw-pojo', '${context.javaBeanNameLF}/pojo', 'java', '${context.javaBeanName}.java', 'package ${context.packageName}.${context.javaBeanNameLF}.pojo;\n\nimport com.shunwang.business.framework.pojo.BasePojo;\n\npublic class ${context.javaBeanName} extends BasePojo {\n#foreach($column in $columns) \n    private ${column.javaType} ${column.javaFieldName};\n#end\n\n#foreach(${column} in ${columns}) \n    public void set${column.javaFieldNameUF}(${column.javaType} ${column.javaFieldName}){\n        this.${column.javaFieldName} = ${column.javaFieldName};\n    }\n\n    public ${column.javaType} get${column.javaFieldNameUF}(){\n        return this.${column.javaFieldName};\n    }\n\n#end\n}', '1');
INSERT INTO `template_config` VALUES (17, 'sw-dao', '${context.javaBeanNameLF}/dao', 'java', '${context.javaBeanName}Dao.java', 'package ${context.packageName}.${context.javaBeanNameLF}.dao;\n\nimport com.shunwang.business.framework.dao.CrudDao;\nimport ${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName};\n\npublic interface ${context.javaBeanName}Dao extends CrudDao<${context.javaBeanName}> {\n}', '1');
INSERT INTO `template_config` VALUES (18, 'sw-bo', '${context.javaBeanNameLF}/bo', 'java', '${context.javaBeanName}Bo.java', 'package ${context.packageName}.${context.javaBeanNameLF}.bo;\n\nimport org.springframework.stereotype.Service;\n\nimport com.shunwang.business.framework.bo.CrudBo;\nimport ${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName};\n\n@Service\npublic class ${context.javaBeanName}Bo extends CrudBo<${context.javaBeanName}, ${context.javaBeanName}Dao> {\n\n}', '1');
INSERT INTO `template_config` VALUES (19, 'durc_jspEasyUICRUD', 'jsp', 'jsp', '${context.javaBeanNameLF}.jsp', '<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\"\n    pageEncoding=\"UTF-8\"%>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>å¢žåˆ æ”¹æŸ¥åˆ—å­</title>\n</head>\n<body>\n\n	<div class=\"easyui-panel search-panel\">\n		 <form id=\"schForm\">\n	        <table>\n                    <tr>\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})\n            <td class=\"fm_lab\">${column.javaFieldName}:</td><td><input name=\"${column.javaFieldName}Sch\" type=\"text\"></td>      \n    #end\n#end\n<td><a id=\"schBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-search\">æŸ¥è¯¢</a></td>\n                 </tr>\n	        </table>\n	    </form>\n	</div>\n\n	<div id=\"toolbar\">\n	    <a id=\"addBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-add\" plain=\"true\">æ·»åŠ </a>\n	</div>\n    \n    <table id=\"dg\"></table>\n    \n    <div id=\"dlg\" class=\"easyui-dialog\" style=\"width:320px;height:280px;padding:10px 20px\"\n            closed=\"true\" modal=\"true\" buttons=\"#dlg-buttons\">\n        <form id=\"fm\" method=\"post\">\n            <table>\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})\n        <tr>\n            <td class=\"fm_lab\">${column.javaFieldName}:</td><td><input name=\"${column.javaFieldName}\" type=\"text\" class=\"easyui-validatebox\" required=\"true\"></td>\n        </tr>\n    #end\n#end\n            </table>\n        </form>\n    </div>\n    <div id=\"dlg-buttons\">\n        <a id=\"saveBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-ok\">ä¿å­˜</a>\n        <a id=\"cancelBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-cancel\">å–æ¶ˆ</a>\n    </div>\n    \n<jsp:include page=\"../easyui_lib.jsp\"></jsp:include>\n<script type=\"text/javascript\">\n#set($jq=\"$\") \n(function(){\nvar that = this;\n\nvar pk = \'${context.javaPkName}\'; // javaç±»ä¸­çš„ä¸»é”®å­—æ®µ\nvar listUrl = ctx + \'list${context.javaBeanName}.do\'; // æŸ¥è¯¢\nvar addUrl = ctx + \'add${context.javaBeanName}.do\'; // æ·»åŠ \nvar updateUrl = ctx + \'update${context.javaBeanName}.do\'; // ä¿®æ”¹\nvar delUrl = ctx + \'del${context.javaBeanName}.do\'; // åˆ é™¤\nvar submitUrl = \'\'; // æäº¤URL\n\nvar toolbarId = \'toolbar\'; // å·¥å…·æ¡ID\n\nvar ${jq}dialog = ${jq}(\'#dlg\'); // çª—å£\nvar ${jq}form = ${jq}(\'#fm\'); // è¡¨å•\nvar ${jq}grid = ${jq}(\'#dg\'); // è¡¨æ ¼\nvar ${jq}schForm = ${jq}(\'#schForm\'); // æŸ¥è¯¢è¡¨å•\n\nvar ${jq}schBtn = ${jq}(\'#schBtn\'); // æŸ¥è¯¢æŒ‰é’®\nvar ${jq}saveBtn = ${jq}(\'#saveBtn\'); // ä¿å­˜æŒ‰é’®\nvar ${jq}cancelBtn = ${jq}(\'#cancelBtn\'); // å–æ¶ˆæŒ‰é’®\nvar ${jq}addBtn = ${jq}(\'#addBtn\'); // æ·»åŠ æŒ‰é’®\n\n// åˆå§‹åŒ–è¡¨æ ¼\n${jq}grid.datagrid({    \n	url:listUrl\n   	,columns:[[\n#set($i=0)\n#foreach($column in $columns)\n    #if($i>0),#end\n    #if(!${column.isIdentityPk})\n    {field:\'${column.javaFieldName}\',title:\'${column.javaFieldName}\'}\n    #set($i=$i+1)\n    #end    \n#end \n   	     ,{field:\'_btn1\',title:\'æ“ä½œ\',align:\'center\',formatter:function(val,row){\n   	    	 return \'<a onclick=\"\'+FunUtil.createFun(that,\'edit\',row)+\' return false;\">ä¿®æ”¹</a>\'\n   	    	 + \'<span class=\"opt-split\">|</span>\'\n   	    	 + \'<a onclick=\"\'+FunUtil.createFun(that,\'del\',row)+\' return false;\">åˆ é™¤</a>\'\n   	     }}\n   	]]\n   	,toolbar:\'#\' + toolbarId\n	,pagination:true\n	,fitColumns:true\n	,singleSelect:true\n	,striped:true\n    ,pageSize:20\n});\n\n// åˆå§‹åŒ–äº‹ä»¶\n${jq}addBtn.click(function(){\n	${jq}dialog.dialog(\'open\').dialog(\'setTitle\',\'æ·»åŠ \');\n	${jq}form.form(\'reset\');\n	submitUrl = addUrl;\n});\n\n${jq}schBtn.click(function(){\n	var data = getFormData(${jq}schForm);\n	${jq}grid.datagrid(\'load\',data);\n});\n\n${jq}saveBtn.click(function(){\n	save();\n});\n\n${jq}cancelBtn.click(function(){\n	${jq}dialog.dialog(\'close\');\n});\n\n\n// ç¼–è¾‘\nthis.edit = function(row){\n	if (row){\n		${jq}dialog.dialog(\'open\').dialog(\'setTitle\',\'ä¿®æ”¹\');\n		${jq}form.form(\'clear\').form(\'load\',row);\n		\n		submitUrl = updateUrl + [\'?\',pk,\'=\',row[pk]].join(\'\');\n	}\n}\n\n// ä¿å­˜\nthis.save = function(){\n	var self = this;\n	${jq}form.form(\'submit\',{\n		url: submitUrl,\n		onSubmit: function(){\n			return ${jq}(this).form(\'validate\');\n		},\n		success: function(resultTxt){\n			var result = ${jq}.parseJSON(resultTxt);\n			Action.execResult(result,function(result){\n				${jq}dialog.dialog(\'close\');// close the dialog\n				${jq}grid.datagrid(\'reload\');\n			});\n		}\n	});\n}\n\n// åˆ é™¤\nthis.del = function(row){\n	if(row){\n		${jq}.messager.confirm(\'ç¡®è®¤\',\'ç¡®å®šè¦åˆ é™¤è¯¥æ•°æ®å—?\',function(r){\n			if (r){\n				Action.post(delUrl,row,function(result){\n					Action.execResult(result,function(result){\n						${jq}grid.datagrid(\'reload\');\n					});\n				});\n			}\n		});\n	}\n}\n\n})();\n</script>\n</body>\n</html>', '1');
INSERT INTO `template_config` VALUES (20, 'sw-mybatis-mysql', '${context.javaBeanNameLF}/mapper', 'xml', '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao\">\n<resultMap id=\"BaseResultMap\" type=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n#foreach($column in $columns)\n    <result property=\"${column.javaFieldName}\" column=\"${column.columnName}\" jdbcType=\"${column.mybatisJdbcType}\"/>\n#end    \n</resultMap>\n    <select id=\"query\" resultMap=\"BaseResultMap\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" >\n        SELECT *\n	FROM ${table.tableName} t\n	<include refid=\"conditionQuery.core\" />\n	<choose>\n		<when test=\"paramMap.orderCol!=null\">\n			ORDER BY ${paramMap.orderCol}\n		</when>\n		<otherwise>\n			ORDER BY ${context.pkName} desc\n		</otherwise>\n	</choose>\n	<if test=\"paramMap.rp>0\">\n		LIMIT #{paramMap.firstResult},#{paramMap.rp}\n	</if>\n    </select>\n\n    <select id=\"get\" resultMap=\"BaseResultMap\" parameterType=\"java.lang.Integer\" >\n   SELECT \n#set ($i=0) \n        #foreach($column in $columns)                          \n                #if($i > 0),#end \n                ${column.columnName}\n                  #set($i=$i+ 1)                  \n        #end\n        FROM ${table.tableName}\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n     </select>\n    <delete id=\"delete\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" >\n       DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n    <insert id=\"save\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" useGeneratedKeys=\"true\" keyProperty=\"${context.javaPkName}\">\n        INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end ${column.columnName}\n               #set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n        #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n               #set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n    <select id=\"queryCnt\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" resultType=\"java.lang.Integer\" >\n        select count(*) from ${table.tableName} t\n        <include refid=\"conditionQuery.core\" />\n    </select>\n\n    <update id=\"update\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk})               \n        #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n               #set($i=$i +1)\n            #end          \n        #end    \n    WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n</mapper>', '1');
INSERT INTO `template_config` VALUES (23, 'durc-jspFduiCRUD', 'jsp', NULL, '${context.javaBeanNameLF}.jsp', '<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\"\n    pageEncoding=\"UTF-8\"%>\n<%@ include file=\"../taglib.jsp\" %>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>å¢žåˆ æ”¹æŸ¥</title>\n</head>\n<body>\n<div class=\"search-wrap\">\n		<div class=\"search-content\">\n        	<table class=\"search-tab\">\n				<tr>\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})\n            <th>${column.javaFieldName}:</th><td id=\"txt-${column.javaFieldName}Sch\"></td>      \n    #end\n#end\n					<td>\n						<div id=\"btnSch\"></div>\n					</td>\n				</tr>\n       		</table>\n       </div>\n   </div>\n   <div class=\"result-wrap\">\n		<div class=\"result-title\">\n             <div class=\"result-list\">\n                 <a id=\"addNew\" href=\"javascript:void(0)\"><i class=\"icon-font\">î€¦</i>æ–°å¢ž</a>\n             </div>\n		</div>\n		<div class=\"result-content\">\n			<div id=\"grid\"></div>\n		</div>\n   </div>\n   \n   <div id=\"crudWin\" style=\"display: none;\">\n   		<table class=\"insert-tab\" width=\"100%\">\n   		<caption id=\"formMsg\"></caption>\n        	<tbody>\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})\n        <tr>\n            <th>${column.javaFieldName}:</th><td id=\"txt-${column.javaFieldName}\"></td>\n        </tr>\n    #end\n#end\n         	</tbody>\n         </table>\n   </div>\n\n<script type=\"text/javascript\">\n(function(){\n	\nvar schPanel;\nvar grid;\nvar formPanel;\nvar crudWin;\n\nvar pk = \'${context.javaPkName}\'; // javaç±»ä¸­çš„ä¸»é”®å­—æ®µ\nvar listUrl = ctx + \'list${context.javaBeanName}.do\'; // æŸ¥è¯¢\nvar addUrl = ctx + \'add${context.javaBeanName}.do\'; // æ·»åŠ \nvar updateUrl = ctx + \'update${context.javaBeanName}.do\'; // ä¿®æ”¹\nvar delUrl = ctx + \'del${context.javaBeanName}.do\'; // åˆ é™¤\n	\nschPanel = new FDFormPanel({\n	controls:[\n#set($i=0)\n#foreach($column in $columns) \n    #if(!${column.isIdentityPk})\n       #if($i>0),#end   new FDTextBox({domId:\'txt-${column.javaFieldName}Sch\',name:\'${column.javaFieldName}Sch\'})      \n      #set($i=$i+1)   \n #end\n#end\n	]\n});\n\nnew FDButton({domId:\'btnSch\',text:\'æŸ¥è¯¢\',onclick:function(){\n	search();\n}});\n\ngrid = new FDGrid({\n	domId:\'grid\'\n	,url:listUrl\n	,columns:[\n#set($i=0)\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})    \n    #if($i>0),#end {text:\'${column.javaFieldName}\',name:\'${column.javaFieldName}\'}\n    #set($i=$i+1)\n    #end    \n#end \n	]\n	,actionButtons:[\n		{text:\'ä¿®æ”¹\',onclick:update}\n		,{text:\'åˆ é™¤\',onclick:del}\n	]\n});\n\ncrudWin = new FDWindow({\n	contentId:\'crudWin\'\n	,buttons:[\n		{text:\'ä¿å­˜\',onclick:function(){\n			formPanel.save();\n		}}\n		,{text:\'å–æ¶ˆ\',onclick:function(){\n			crudWin.hide();\n		}}\n	]\n});\n\nformPanel = new FDFormPanel({\n	grid:grid\n	,win:crudWin\n	// æœåŠ¡å™¨ç«¯çš„è¯·æ±‚\n	,crudUrl:{\n		add: addUrl\n		,update: updateUrl\n		,del: delUrl\n	}\n	,controls:[\n	    new FDHidden({name:pk,defaultValue:0})\n#foreach($column in $columns)\n    #if(!${column.isIdentityPk})\n        ,new FDTextBox({domId:\'txt-${column.javaFieldName}\',name:\'${column.javaFieldName}\',msgId:\'formMsg\',width:200\n			,validates:[\n		     {rule:{notNull:true},successClass:\'green\',errorClass:\'require-red\',errorMsg:\'${column.javaFieldName}ä¸èƒ½ä¸ºç©º\'}\n             ]\n        })\n    #end\n#end\n	]\n});\n\n$(\'#addNew\').click(function(){\n	add();\n});\n\nfunction add() {\n	formPanel.add();\n}\n\nfunction update(rowData,rowIndex) {\n	formPanel.update(rowData);\n}\n\n\nfunction del(row,rowIndex) {\n	formPanel.del(row);\n}\n\nfunction search() {\n	grid.search(schPanel.getData());\n}\n	\n})();\n</script>\n</body>\n</html>', '1');
INSERT INTO `template_config` VALUES (24, 'serviceImpl', 'service\\impl', NULL, '${context.javaBeanName}ServiceImpl.java', 'package ${context.packageName}.service.impl;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport ${context.packageName}.dao.${context.javaBeanName}Mapper;\n\n@Service\npublic class ${context.javaBeanName}ServiceImpl implements ${context.javaBeanName}Service  {\n\n    @Autowired\n    private ${context.javaBeanName}Mapper ${context.javaBeanNameLF}Mapper;\n\n    @Override\n    int deleteByPrimaryKey(${context.javaPkType} ${context.javaPkName}){\n        return ${context.javaBeanNameLF}Mapper.deleteByPrimaryKey(${context.javaPkName});\n    }\n\n    @Override\n    int insert(${context.javaBeanName} record){\n        return ${context.javaBeanNameLF}Mapper.insert(record);\n    }\n\n    @Override\n    int insertSelective(${context.javaBeanName} record){\n        return ${context.javaBeanNameLF}Mapper.insertSelective(record);\n    }\n\n    @Override\n    ShakeDevice selectByPrimaryKey(${context.javaPkType} ${context.javaPkName}){\n        return ${context.javaBeanNameLF}Mapper.selectByPrimaryKey(${context.javaPkName});\n    }\n\n    @Override\n    int updateByPrimaryKeySelective(${context.javaBeanName} record){\n        return ${context.javaBeanNameLF}Mapper.updateByPrimaryKeySelective(record);\n    }\n\n    @Override\n    int updateByPrimaryKey(${context.javaBeanName} record){\n        return ${context.javaBeanNameLF}Mapper.updateByPrimaryKey(record);\n    }\n}', '1');
INSERT INTO `template_config` VALUES (25, 'controller', 'controller', NULL, '${context.javaBeanName}Controller.java', 'test', '1');
INSERT INTO `template_config` VALUES (28, 'o2o_durc_Service', 'service', NULL, '${context.javaBeanName}Service.java', 'package ${context.packageName}.service;\n\nimport ${context.packageName}.domain.${context.javaBeanName};\n\nimport com.weimob.o2o.mgr.common.service.CrudServiceInterface;\n\npublic interface ${context.javaBeanName}Service extends CrudServiceInterface<${context.javaBeanName}> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (29, 'o2o_durc_ServiceImpl', 'service/impl', NULL, '${context.javaBeanName}ServiceImpl.java', 'package ${context.packageName}.service.impl;\n\nimport org.durcframework.core.service.CrudService;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport ${context.packageName}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport org.springframework.stereotype.Service;\n    \n@Service\npublic class ${context.javaBeanName}ServiceImpl \n        extends CrudService<${context.javaBeanName}, ${context.javaBeanName}Dao> \n        implements ${context.javaBeanName}Service {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (30, 'o2o_durc_DAO', 'dao', 'java', '${context.javaBeanName}Dao.java', 'package ${context.packageName}.dao;\n\nimport org.durcframework.core.dao.BaseDao;\nimport ${context.packageName}.domain.${context.javaBeanName};\n\npublic interface ${context.javaBeanName}Dao extends BaseDao<${context.javaBeanName}> {\n}', 'admin');
INSERT INTO `template_config` VALUES (31, 'o2o_durc_domain', 'domain', 'java', '${context.javaBeanName}.java', 'package ${context.packageName}.domain;\n\nimport java.io.Serializable;\nimport java.util.Date;\nimport lombok.AllArgsConstructor;\nimport lombok.NoArgsConstructor;\nimport lombok.ToString;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString\n@Data\npublic class ${context.javaBeanName} implements Serializable {\n#foreach($column in $columns) \n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n#end\n}', 'admin');
INSERT INTO `template_config` VALUES (32, 'o2o_durc_SchEntity', 'domain/sch', 'java', '${context.javaBeanName}Sch.java', 'package ${context.packageName}.domain.sch;\n\nimport java.util.Date;\n\nimport org.durcframework.core.SearchEntity;\nimport org.durcframework.core.expression.annotation.ValueField;\n\npublic class ${context.javaBeanName}Sch extends SearchEntity{\n\n#foreach($column in $columns) \n    private ${column.javaTypeBox} ${column.javaFieldName}Sch;\n#end\n\n#foreach(${column} in ${columns}) \n    public void set${column.javaFieldNameUF}Sch(${column.javaTypeBox} ${column.javaFieldName}Sch){\n        this.${column.javaFieldName}Sch = ${column.javaFieldName}Sch;\n    }\n    \n    @ValueField(column = \"${column.columnName}\")\n    public ${column.javaTypeBox} get${column.javaFieldNameUF}Sch(){\n        return this.${column.javaFieldName}Sch;\n    }\n\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (33, 'o2o_durc_Mybatis', 'dao/mapper', 'xml', '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.domain.${context.javaBeanName}\">\n        #foreach($column in $columns)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n        #end\n    </resultMap>\n\n    <select id=\"find\" parameterType=\"org.durcframework.core.expression.ExpressionQuery\"\n        resultMap=\"queryResultMap\">\n        SELECT t.*\n        FROM ${table.tableName} t\n        <include refid=\"expressionBlock.where\" />\n        <choose>\n            <when test=\"sortname == null\">\n                ORDER BY t.${context.pkName} desc\n            </when>\n            <otherwise>\n                ORDER BY ${order}\n            </otherwise>\n        </choose>\n        <if test=\"!isQueryAll\">\n            LIMIT\n            #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}\n        </if>\n    </select>\n\n\n    <select id=\"findTotalCount\" parameterType=\"org.durcframework.core.expression.ExpressionQuery\"\n        resultType=\"java.lang.Integer\">\n        SELECT count(*) FROM ${table.tableName} t\n        <include refid=\"expressionBlock.where\" />\n    </select>\n\n    <insert id=\"save\" parameterType=\"${context.packageName}.domain.${context.javaBeanName}\"\n#if(${pkColumn.isIdentity})\n    keyProperty=\"${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end `${column.columnName}`\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n\n\n    <update id=\"update\" parameterType=\"${context.packageName}.domain.${context.javaBeanName}\">\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk})               \n        #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #set($i=$i+1)       \n     #end          \n        #end    \n    WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" parameterType=\"${context.packageName}.domain.${context.javaBeanName}\" >\n        UPDATE ${table.tableName}\n        <set>\n            set #foreach($column in $columns) \n                #if(!${column.isPk}) \n                <if test=\"${column.columnName} !=null\">\n                    ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n                </if>\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <select id=\"get\" resultMap=\"queryResultMap\" parameterType=\"${context.packageName}.domain.${context.javaBeanName}\">\n        SELECT t.*\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <delete id=\"del\" parameterType=\"${context.packageName}.domain.${context.javaBeanName}\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n</mapper>', 'admin');
INSERT INTO `template_config` VALUES (34, 'order-dao', 'dao', NULL, '${context.javaBeanName}Dao.java', 'package ${context.packageName}.dao;\n\nimport com.weimob.sbu.common.BaseShardDao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.vo.${context.javaBeanName}QueryBean;\n\npublic interface ${context.javaBeanName}Dao  extends BaseShardDao<${context.javaBeanName},${context.javaBeanName}QueryBean> {\n}', 'admin');
INSERT INTO `template_config` VALUES (35, 'order-domain', 'domain', NULL, '${context.javaBeanName}.java', 'package ${context.packageName}.domain;\n\nimport java.io.Serializable;\nimport java.math.BigDecimal;\nimport java.util.Date;\nimport lombok.AllArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.NoArgsConstructor;\nimport lombok.ToString;\nimport lombok.Data;\nimport com.weimob.common.mgr.shard.BaseShard;\nimport com.weimob.sbu.common.ShardByMerchendId;\nimport com.weimob.sbu.common.ShardByMerchantIdDomain;\n\n\n/**\n *${table.comment}对应实体类\n*/\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@Data\n@EqualsAndHashCode(callSuper=true)\npublic class ${context.javaBeanName} extends ShardByMerchantIdDomain implements ShardByMerchendId,Serializable {\n#foreach($column in $columns) \n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n#end\n	\n    @Override\n	public Integer getTableIndex() {\n		// TODO Auto-generated method stub\n		return null;\n	}\n\n}', 'admin');
INSERT INTO `template_config` VALUES (36, 'order-qrybean', 'domain/vo', NULL, '${context.javaBeanName}QueryBean.java', 'package ${context.packageName}.domain.vo;\n\nimport java.util.Date;\nimport java.math.BigDecimal;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport lombok.NoArgsConstructor;\nimport lombok.ToString;\n\nimport org.durcframework.core.SearchEntity;\n\nimport com.weimob.common.mgr.shard.BaseShard;\nimport com.weimob.sbu.common.BaseQueryBean;\nimport com.weimob.sbu.common.Shard;\n\n/**\n *${table.comment}查询条件类\n*/\n@Data\n@NoArgsConstructor\n@EqualsAndHashCode(callSuper=false)\n@ToString(callSuper = true)\npublic class ${context.javaBeanName}QueryBean implements Shard{\n\n#foreach($column in $columns) \n	/** ${column.comment} */\n    private ${column.javaTypeBox} ${column.javaFieldName};\n#end\n\n    private Integer tableIndex;\n\n}', 'admin');
INSERT INTO `template_config` VALUES (37, 'order-mybatis', 'dao/mapper', NULL, '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.domain.${context.javaBeanName}\">\n        #foreach($column in $columns)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n        #end\n    </resultMap>\n	<sql id=\"Base_Column_List\" >\n        #foreach($column in $columns)             \n         #if(${velocityCount} > 1),#end ${column.columnName} \n        #end\n    </sql>\n    <sql id=\"query_condition\" >\n    	#foreach($column in $columns) \n            #if(!${column.isPk}) \n            <if test=\"query.${column.javaFieldName} !=null\">\n                and ${column.columnName}=#{query.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n            </if>\n            #end\n        #end\n    </sql>\n    <select id=\"findByCondition\" \n        resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n        <choose>\n            <when test=\"query.sortname == null\">\n                ORDER BY t.${context.pkName} desc\n            </when>\n            <otherwise>\n                ORDER BY ${order}\n            </otherwise>\n        </choose>\n    </select>\n\n\n    <select id=\"findTotalCount\" \n        resultType=\"java.lang.Integer\">\n        SELECT count(1) FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n    </select>\n\n    <insert id=\"save\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n\n\n    <update id=\"update\" >\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk})               \n        #if($i > 0),#end ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #set($i=$i+1)       \n     #end          \n        #end    \n    WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" >\n        UPDATE ${table.tableName}\n        <set>\n            #foreach($column in $columns) \n                #if(!${column.isPk}) \n                <if test=\"entity.${column.javaFieldName} !=null\">\n                    ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n                </if>\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <select id=\"getByPrimaryKey\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{id,jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <select id=\"get\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <delete id=\"delByPrimaryKey\" >\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{id ,jdbcType=${context.mybatisPkType}}\n    </delete>\n\n    <delete id=\"del\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n	<insert id=\"saveBatch\">\n    	INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES \n    <foreach collection=\"entities\" index=\"index\" item=\"entity\" separator=\",\">\n    	(\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk})               \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n        </foreach>\n	</insert>\n	\n</mapper>', 'admin');
INSERT INTO `template_config` VALUES (38, 'order-service', 'service', NULL, '${context.javaBeanName}Service.java', 'package ${context.packageName}.service;\n\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.vo.${context.javaBeanName}QueryBean;\n\nimport com.weimob.common.mgr.service.CrudService;\n\npublic interface ${context.javaBeanName}Service extends CrudService<${context.javaBeanName},${context.javaBeanName}QueryBean> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (39, 'order-svImpl', 'service/impl', NULL, '${context.javaBeanName}ServiceImpl.java', 'package ${context.packageName}.service.impl;\n\nimport lombok.extern.log4j.Log4j2;\n\nimport com.weimob.common.mgr.service.AbstractCrudService;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport ${context.packageName}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.vo.${context.javaBeanName}QueryBean;\n\nimport org.springframework.stereotype.Service;\n \n@Log4j2   \n@Service\npublic class ${context.javaBeanName}ServiceImpl \n        extends AbstractCrudService<${context.javaBeanName},${context.javaBeanName}QueryBean, ${context.javaBeanName}Dao> \n        implements ${context.javaBeanName}Service {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (40, 'order-mng', 'manager', NULL, '${context.javaBeanName}Manager.java', 'package ${context.packageName}.manager;\n\npublic interface ${context.javaBeanName}Manager {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (41, 'order-mngImpl', 'manager/impl', NULL, '${context.javaBeanName}ManagerImpl.java', 'package ${context.packageName}.manager.impl;\n\nimport lombok.extern.log4j.Log4j2;\n\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport ${context.packageName}.manager.${context.javaBeanName}Manager;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n    \n@Log4j2\n@Service\npublic class ${context.javaBeanName}ManagerImpl\n        implements ${context.javaBeanName}Manager {\n\n    @Autowired\n    private ${context.javaBeanName}Service ${context.javaBeanNameLF}Service;\n    \n\n}', 'admin');
INSERT INTO `template_config` VALUES (42, 'test_mgr', 'test/manager/impl', NULL, '${context.javaBeanName}ManagerImplTest.java', 'package ${context.packageName}.manager.impl;\n\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport mockit.Injectable;\nimport mockit.Tested;\nimport mockit.integration.junit4.JMockit;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n/**\n * Created by autoCode.\n */\n@RunWith(JMockit.class)\npublic class ${context.javaBeanName}ManagerImplTest {\n\n    @Tested\n    private ${context.javaBeanName}ManagerImpl ${context.javaBeanNameLF}Manager;\n    @Injectable\n    private ${context.javaBeanName}Service ${context.javaBeanNameLF}Service;\n\n    @Test\n    public void test() {\n        // do something\n    }\n\n}\n', 'admin');
INSERT INTO `template_config` VALUES (43, 'v2_01_facade', 'facade', NULL, '${context.javaBeanName}Facade.java', 'package ${context.packageName}.facade;\n\nimport com.weimob.sst.framework.facade.CrudFacade;\nimport ${context.packageName}.dto.${context.javaBeanName}Dto;\nimport ${context.packageName}.dto.${context.javaBeanName}QueryDto;\n\npublic interface ${context.javaBeanName}Facade extends CrudFacade<${context.javaBeanName}Dto, ${context.javaBeanName}QueryDto> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (44, 'v2_02_manager', 'manager', NULL, '${context.javaBeanName}Manager.java', 'package ${context.packageName}.manager;\n\nimport com.weimob.sst.framework.manager.CrudManager;\nimport ${context.packageName}.dto.${context.javaBeanName}Dto;\nimport ${context.packageName}.dto.${context.javaBeanName}QueryDto;\n\npublic interface ${context.javaBeanName}Manager extends CrudManager<${context.javaBeanName}Dto, ${context.javaBeanName}QueryDto> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (45, 'v2_05_service', 'service', NULL, '${context.javaBeanName}Service.java', 'package ${context.packageName}.service;\n\nimport com.weimob.sst.framework.service.CrudDalService;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\n\npublic interface ${context.javaBeanName}Service extends CrudDalService<${context.javaBeanName}, ${context.javaBeanName}Query> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (46, 'v2_06_dal_for_dao', 'dal/impl', NULL, '${context.javaBeanName}DalImpl.java', 'package ${context.packageName}.dal.impl;\n\nimport com.weimob.sst.framework.dal.AbstractBaseDalForDao;\nimport ${context.packageName}.dal.${context.javaBeanName}Dal;\nimport ${context.packageName}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}DalImpl extends AbstractBaseDalForDao<${context.javaBeanName}, ${context.javaBeanName}Query, ${context.javaBeanName}Dao> implements ${context.javaBeanName}Dal {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (47, 'v2_09_dao', 'dao', NULL, '${context.javaBeanName}Dao.java', 'package ${context.packageName}.dao;\n\nimport com.weimob.sst.framework.dao.BaseShardDao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\n\npublic interface ${context.javaBeanName}Dao extends BaseShardDao<${context.javaBeanName}, ${context.javaBeanName}Query> {\n}', 'admin');
INSERT INTO `template_config` VALUES (48, 'v2_10_mapper', 'dao/mapper', NULL, '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.domain.${context.javaBeanName}\">\n        #foreach($column in $columns)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n        #end\n    </resultMap>\n    \n	<sql id=\"Base_Column_List\" >\n        #foreach($column in $columns)             \n         #if(${velocityCount} > 1),#end ${column.columnName} \n        #end\n    </sql>\n    \n    <sql id=\"query_condition\" >\n    	#foreach($column in $columns) \n            #if(!${column.isPk}) \n            <if test=\"query.${column.javaFieldName} !=null\">\n                and ${column.columnName}=#{query.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n            </if>\n            #end\n        #end\n    </sql>\n    \n    <select id=\"findByCondition\" \n        resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n        <choose>\n            <when test=\"query.sortName == null\">\n                ORDER BY t.${context.pkName} desc\n            </when>\n            <otherwise>\n                ORDER BY ${query.sortName}\n            </otherwise>\n        </choose>\n    </select>\n\n    <select id=\"findTotalCount\" \n        resultType=\"java.lang.Integer\">\n        SELECT count(1) FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n    </select>\n\n    <insert id=\"save\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n\n    <insert id=\"saveSelective\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              ${column.columnName},\n              </if>\n            #end          \n        #end\n        </trim>\n    VALUES \n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n            </if>\n            #end          \n        #end\n        </trim>\n    </insert>\n\n    <update id=\"update\" >\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #set($i=$i+1)       \n     #end          \n        #end    \n    WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" >\n        UPDATE ${table.tableName}\n        <set>\n            #foreach($column in $columns) \n                #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\") \n                <if test=\"entity.${column.javaFieldName} !=null\">\n                    ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n                </if>\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <select id=\"getByPrimaryKey\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{id,jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <select id=\"get\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <delete id=\"delByPrimaryKey\" >\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{id ,jdbcType=${context.mybatisPkType}}\n    </delete>\n\n    <delete id=\"del\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n	<insert id=\"saveBatch\">\n    	INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES \n    <foreach collection=\"entities\" index=\"index\" item=\"entity\" separator=\",\">\n    	(\n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n        </foreach>\n	</insert>\n	\n</mapper>', 'admin');
INSERT INTO `template_config` VALUES (49, 'v2_07_domain', 'domain', NULL, '${context.javaBeanName}.java', 'package ${context.packageName}.domain;\n\nimport com.weimob.sst.framework.shard.BaseShardDomain;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName} extends BaseShardDomain implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (51, 'v2_03_dto', 'dto', NULL, '${context.javaBeanName}Dto.java', 'package ${context.packageName}.dto;\n\nimport com.weimob.sst.framework.dto.BaseDto;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n/**\n *${table.comment}对应实体类Dto\n*/\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}Dto extends BaseDto implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (53, 'v2_01_facadeImpl', 'facade/impl', NULL, '${context.javaBeanName}FacadeImpl.java', 'package ${context.packageName}.facade.impl;\n\nimport com.weimob.sst.framework.facade.AbstractFacade;\nimport ${context.packageName}.dto.${context.javaBeanName}Dto;\nimport ${context.packageName}.dto.${context.javaBeanName}QueryDto;\nimport ${context.packageName}.facade.${context.javaBeanName}Facade;\nimport ${context.packageName}.manager.${context.javaBeanName}Manager;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}FacadeImpl extends AbstractFacade<${context.javaBeanName}Dto, ${context.javaBeanName}QueryDto, ${context.javaBeanName}Manager> implements ${context.javaBeanName}Facade {\n}', 'admin');
INSERT INTO `template_config` VALUES (54, 'v2_02_managerImpl', 'manager/impl', NULL, '${context.javaBeanName}ManagerImpl.java', 'package ${context.packageName}.manager.impl;\n\nimport com.weimob.sst.framework.manager.AbstractManager;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\nimport ${context.packageName}.dto.${context.javaBeanName}Dto;\nimport ${context.packageName}.dto.${context.javaBeanName}QueryDto;\nimport ${context.packageName}.manager.${context.javaBeanName}Manager;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}ManagerImpl extends AbstractManager<${context.javaBeanName}Dto, ${context.javaBeanName}QueryDto, ${context.javaBeanName}, ${context.javaBeanName}Query, ${context.javaBeanName}Service> implements ${context.javaBeanName}Manager {\n}', 'admin');
INSERT INTO `template_config` VALUES (55, 'v2_05_serviceImpl', 'service/impl', NULL, '${context.javaBeanName}ServiceImpl.java', 'package ${context.packageName}.service.impl;\n\nimport com.weimob.sst.framework.service.AbstractDalCrudService;\nimport ${context.packageName}.dal.${context.javaBeanName}Dal;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}ServiceImpl extends AbstractDalCrudService<${context.javaBeanName}, ${context.javaBeanName}Query, ${context.javaBeanName}Dal> implements ${context.javaBeanName}Service {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (56, 'v2_06_dal', 'dal', NULL, '${context.javaBeanName}Dal.java', 'package ${context.packageName}.dal;\n\nimport com.weimob.sst.framework.dal.BaseDal;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\n\npublic interface ${context.javaBeanName}Dal extends BaseDal<${context.javaBeanName}, ${context.javaBeanName}Query> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (57, 'v2_04_dto_query', 'dto', NULL, '${context.javaBeanName}QueryDto.java', 'package ${context.packageName}.dto;\n\nimport com.weimob.sst.framework.dto.BaseQueryDto;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n/**\n *${table.comment}对应实体类QueryDto\n*/\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}QueryDto extends BaseQueryDto implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (58, 'v2_08_domain_query', 'domain', NULL, '${context.javaBeanName}Query.java', 'package ${context.packageName}.domain;\n\nimport com.weimob.sst.framework.domain.BaseQuery;\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}Query extends BaseQuery implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (59, 'v2_11_controller', 'controller', NULL, 'controller', 'controller', 'admin');
INSERT INTO `template_config` VALUES (61, 'fe-03-list.html', 'pages/${context.javaBeanName}', NULL, '${context.javaBeanName}.list.html', '<section class=\"vbox\" ui-view>\n    <header class=\"header bg-white b-b clearfix\">\n      <p>列表</p>\n    </header>\n    <section class=\"scrollable wrapper w-f\">\n      <div class=\"form-inline\">\n        <a class=\"btn btn-info btn-sm\" ui-sref=\"app.${context.javaBeanNameLF}.add()\">新建</a>\n      </div>\n      <section class=\"panel panel-default m-t\">\n        <div class=\"table-responsive\" loading-container=\"tableParams.settings().$loading\">\n          <table ng-table=\"tableParams\" class=\"table table-striped table-hover m-b-none\" pager-target=\"#ng-pagination\" checkbox-show=\"true\" checkbox-key=\"storeId\">\n            <tr ng-repeat=\"item in list\">\n            #set($count = 1)\n            #foreach($column in $columns)\n              #if(!${column.isPk} and ${column.javaFieldName} != \"merchantId\" and ${column.javaFieldName} != \"createTime\" and ${column.javaFieldName} != \"updateTime\" and ${column.javaFieldName} != \"version\")\n                <td data-title=\"\'${column.comment}\'\">\n                #if ($count == 1) \n                  #set($count = 2)\n                  <a ui-sref=\"app.${context.javaBeanNameLF}.detail({${context.javaPkName}:item.${context.javaPkName}})\" class=\"text-href m-r\">{{item.${column.javaFieldName}}}</a>\n                #else\n                  {{item.${column.javaFieldName}}}\n                #end\n                </td>\n              #end\n            #end\n              <td data-title=\"\'操作\'\">\n                <a ui-sref=\"app.${context.javaBeanNameLF}.add({${context.javaPkName}:item.${context.javaPkName}})\" class=\"text-href m-r\">编辑</a>\n\n                <a class=\"text-href m-r text-nowrap\" popup-confirm popup-placement=\"left\" popup-title=\"删除\" popup-body=\"确定删除?\" popup-confirm-button=\"删除\" popup-confirm-callback=\"delete(item)\">删除</a>\n              </td>\n            </tr>\n            <tr ng-if=\"!tableParams.settings().$loading\" class=\"text-center\">\n              <td colspan=\"4\" ng-if=\"list.length==0\">没有找到任何记录!</td>\n            </tr>\n          </table>\n        </div>\n      </section>\n      <!--<div class=\"clearfix text-center m-t-n m-b form-inline\">-->\n        <!--<div class=\"\" id=\"ng-pagination\"></div>-->\n      <!--</div>-->\n    </section>\n    <footer class=\"footer bg-white b-t\">\n      <div class=\"row text-center-xs\">\n        <div class=\"col-md-6 hidden-sm\">\n          <p class=\"text-muted m-t\">总共{{tableParams.total()}}条 当前为第{{tableParams.page()}}页</p>\n        </div>\n        <div class=\"col-md-6 col-sm-12 text-right text-center-xs\" id=\"ng-pagination\"></div>\n      </div>\n    </footer>\n</section>', 'admin');
INSERT INTO `template_config` VALUES (62, 'fe-01-add.html', 'pages/${context.javaBeanName}', NULL, '${context.javaBeanName}.add.html', '<form class=\"form-horizontal hbox\" form-validator formvalidatorconfig=\"eventformvalidate\" method=\"post\">\n  <section class=\"vbox\" ui-view>\n    <header class=\"header bg-white b-b clearfix\">\n      <p>{{entity.${context.javaPkName}?\"编辑\":\"新建\"}}</p>\n    </header>\n    <section class=\"scrollable wrapper w-f\">\n      <section class=\"panel panel-default border-top-none\">\n\n#foreach($column in $columns)\n	#if(!${column.isPk} and ${column.javaFieldName} != \"merchantId\" and ${column.javaFieldName} != \"createTime\" and ${column.javaFieldName} != \"updateTime\" and ${column.javaFieldName} != \"version\")\n          <div class=\"form-group m-t\">\n            <label class=\"col-sm-2 control-label must\">${column.comment}：</label>\n            <div class=\"col-sm-3\">\n              <input type=\"text\" ng-model=\"entity.${column.javaFieldName}\" class=\"form-control\" name=\"${column.javaFieldName}\" data-rule-required=\"true\" />\n            </div>\n          </div>\n#end\n#end\n      </section>\n    </section>\n    <footer class=\"footer bg-white b-t text-right\">\n      <button type=\"submit\" class=\"btn btn-primary ng-isolate-scope\" btn-loading=\"saveloading\" loading-text=\"保存中...\">保存</button>\n      <button type=\"button\" class=\"btn btn-default\" back-state=\"\">取消</button>\n    </footer>\n  </section>\n</form>', 'admin');
INSERT INTO `template_config` VALUES (63, 'fe-02-detail.html', 'pages/${context.javaBeanName}', NULL, '${context.javaBeanName}.detail.html', '<form class=\"form-horizontal hbox\" form-validator formvalidatorconfig=\"eventformvalidate\" method=\"post\">\n  <section class=\"vbox\" ui-view>\n    <header class=\"header bg-white b-b clearfix\">\n      <p>详情</p>\n    </header>\n    <section class=\"scrollable wrapper w-f\">\n      <section class=\"panel panel-default border-top-none\">\n#foreach($column in $columns)\n	#if(!${column.isPk} and ${column.javaFieldName} != \"merchantId\" and ${column.javaFieldName} != \"createTime\" and ${column.javaFieldName} != \"updateTime\" and ${column.javaFieldName} != \"version\")\n          <div class=\"form-group m-t\">\n            <label class=\"col-sm-2 control-label\">${column.comment}：</label>\n            <div class=\"col-sm-6\">\n              <label class=\"col-sm-6 control-label text-left\">{{entity.${column.javaFieldName}}}</label>\n            </div>\n          </div>\n#end\n#end\n      </section>\n    </section>\n  </section>\n</form>', 'admin');
INSERT INTO `template_config` VALUES (68, 'v3_mapper', 'dao/mapper', NULL, '${context.javaBeanNameLF}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.domain.${context.javaBeanName}\">\n        #foreach($column in $columns)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n        #end\n    </resultMap>\n    \n	<sql id=\"Base_Column_List\" >\n        #foreach($column in $columns)             \n         #if(${velocityCount} > 1),#end ${column.columnName} \n        #end\n    </sql>\n    \n    <sql id=\"query_condition\" >\n    	#foreach($column in $columns) \n            #if(!${column.isPk}) \n            <if test=\"query.${column.javaFieldName} !=null\">\n                and ${column.columnName}=#{query.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n            </if>\n            #end\n        #end\n    </sql>\n    \n    <select id=\"findByCondition\" \n        resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n        <choose>\n            <when test=\"query.sortName == null\">\n                ORDER BY t.${context.pkName} desc\n            </when>\n            <otherwise>\n                ORDER BY ${query.sortName}\n            </otherwise>\n        </choose>\n    </select>\n\n    <select id=\"findTotalCount\" \n        resultType=\"java.lang.Integer\">\n        SELECT count(1) FROM ${table.tableName} t\n        <where>\n        	<include refid=\"query_condition\" />\n        </where>\n    </select>\n\n    <insert id=\"save\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n\n    <insert id=\"saveSelective\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              ${column.columnName},\n              </if>\n            #end          \n        #end\n        </trim>\n    VALUES \n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n            </if>\n            #end          \n        #end\n        </trim>\n    </insert>\n\n    <update id=\"update\" >\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #set($i=$i+1)       \n     #end          \n        #end    \n    WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" >\n        UPDATE ${table.tableName}\n        <set>\n            #foreach($column in $columns) \n                #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\") \n                <if test=\"entity.${column.javaFieldName} !=null\">\n                    ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n                </if>\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <select id=\"getByPrimaryKey\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{id,jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <select id=\"get\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n    <delete id=\"delByPrimaryKey\" >\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{id ,jdbcType=${context.mybatisPkType}}\n    </delete>\n\n    <delete id=\"del\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n	<insert id=\"saveBatch\">\n    	INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES \n    <foreach collection=\"entities\" index=\"index\" item=\"entity\" separator=\",\">\n    	(\n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n        </foreach>\n	</insert>\n	\n</mapper>', 'admin');
INSERT INTO `template_config` VALUES (69, 'v3_dao', 'dao', NULL, '${context.javaBeanName}Dao.java', 'package ${context.packageName}.dao;\n\nimport com.weimob.common.framework.dao.BaseDao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\n\npublic interface ${context.javaBeanName}Dao extends BaseDao<${context.javaBeanName}, ${context.javaBeanName}Query> {\n}', 'admin');
INSERT INTO `template_config` VALUES (70, 'v3_domain', 'domain', NULL, '${context.javaBeanName}.java', 'package ${context.packageName}.domain;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}  implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (71, 'v3_domain_query', 'domain', NULL, '${context.javaBeanName}Query.java', 'package ${context.packageName}.domain;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}Query implements Serializable {\n\n#foreach($column in $columns)\n	#if(${column.javaFieldName} != \"merchantId\")\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n    #end\n#end\n\n	private String sortName;\n}', 'admin');
INSERT INTO `template_config` VALUES (72, 'v3_service', 'service', NULL, '${context.javaBeanName}Service.java', 'package ${context.packageName}.service;\n\nimport com.weimob.common.framework.service.CrudService;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\n\npublic interface ${context.javaBeanName}Service extends CrudService<${context.javaBeanName}, ${context.javaBeanName}Query> {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (73, 'v3_serviceImpl', 'service/impl', NULL, '${context.javaBeanName}ServiceImpl.java', 'package ${context.packageName}.service.impl;\n\nimport com.weimob.common.framework.service.AbstractCrudService;\nimport ${context.packageName}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.domain.${context.javaBeanName};\nimport ${context.packageName}.domain.${context.javaBeanName}Query;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}ServiceImpl extends AbstractCrudService<${context.javaBeanName}, ${context.javaBeanName}Query, ${context.javaBeanName}Dao> implements ${context.javaBeanName}Service {\n\n}', 'admin');
INSERT INTO `template_config` VALUES (74, 'order-controller', 'controller', NULL, '${context.javaBeanName}Controller.java', 'package ${context.packageName}.controller;\n\nimport com.weimob.common.web.BaseController;\nimport com.weimob.common.mgr.dao.BaseShardDao;\nimport com.weimob.common.web.GridResult;\nimport com.weimob.common.web.MessageResult;\nimport org.durcframework.core.controller.CrudController;\nimport ${context.packageName}.entity.${context.javaBeanName};\nimport ${context.packageName}.entity.${context.javaBeanName}Sch;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\n@Controller\npublic class ${context.javaBeanName}Controller extends\n		CrudController<${context.javaBeanName}, ${context.javaBeanName}Service> {\n\n	@RequestMapping(\"/add${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult add${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.save(entity);\n	}\n\n	@RequestMapping(\"/list${context.javaBeanName}.do\")\n	public @ResponseBody\n	GridResult list${context.javaBeanName}(${context.javaBeanName}Sch searchEntity) {\n		return this.query(searchEntity);\n	}\n\n	@RequestMapping(\"/update${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult update${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.update(entity);\n	}\n\n	@RequestMapping(\"/del${context.javaBeanName}.do\")\n	public @ResponseBody\n	MessageResult del${context.javaBeanName}(${context.javaBeanName} entity) {\n		return this.delete(entity);\n	}\n	\n}', 'admin');
INSERT INTO `template_config` VALUES (75, 'v4_mapper', 'dao/mapper', NULL, '#if($table.tableName.indexOf(\"t_\") == 0)${context.javaBeanName.substring(1)}Mapper.xml#else${context.javaBeanName}Mapper.xml#end', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.#if($table.tableName.indexOf(\"t_\") == 0)${context.javaBeanName.substring(1)}Dao#else${context.javaBeanName}Dao#end\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.dto.#if($table.tableName.indexOf(\"t_\") == 0)${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end\">\n        #foreach($column in $columns)\n         #if($column.columnName.indexOf(\"_field_\") != 0)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n         #end\n        #end\n    </resultMap>\n    \n	<sql id=\"Base_Column_List\" >\n        #foreach($column in $columns)   \n#if($column.columnName.indexOf(\"_field_\") != 0)          \n         #if(${velocityCount} > 1),#end ${column.columnName} \n#end\n        #end\n    </sql>\n    \n    \n    <insert id=\"save\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n        #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")                         #if($column.columnName.indexOf(\"_field_\") != 0)   \n             #if($i > 0),#end \n            ${column.columnName}\n            #end \n            #set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n            #if($column.columnName.indexOf(\"_field_\") != 0)   \n            #if($i > 0),#end \n            #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n            #set($i=$i +1)\n            #end\n            #end          \n        #end\n \n        )\n    </insert>\n\n    <insert id=\"saveSelective\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")                         #if($column.columnName.indexOf(\"_field_\") != 0) \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              ${column.columnName},\n              </if>\n            #end\n            #end          \n        #end\n        </trim>\n    VALUES \n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n           #if($column.columnName.indexOf(\"_field_\") != 0) \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n            </if>\n             #end\n            #end          \n        #end\n        </trim>\n    </insert>\n\n    <update id=\"update\" >\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n           #if($column.columnName.indexOf(\"_field_\") != 0) \n          #if($i > 0),#end \n          ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n          #set($i=$i+1)       \n          #end\n        #end          \n        #end    \n    WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" >\n        UPDATE ${table.tableName}\n        <set>\n            #foreach($column in $columns) \n                #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")\n                #if($column.columnName.indexOf(\"_field_\") != 0) \n                <if test=\"entity.${column.javaFieldName} !=null\">\n                    ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n                </if>\n                #end\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    \n    <select id=\"get\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n\n    <delete id=\"del\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n	<insert id=\"saveBatch\">\n    	INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")                #if($column.columnName.indexOf(\"_field_\") != 0) \n        #if($i > 0),#end ${column.columnName}\n    #end\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES \n    <foreach collection=\"entities\" index=\"index\" item=\"entity\" separator=\",\">\n    	(\n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")                #if($column.columnName.indexOf(\"_field_\") != 0) \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #end\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n        </foreach>\n	</insert>\n	\n</mapper>', 'admin');
INSERT INTO `template_config` VALUES (76, 'v4_dto', 'dto', NULL, '#if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end.java', 'package ${context.packageName}.dto;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end implements Serializable {\n\n\n#foreach($column in $columns)\n	\n  #if($column.columnName.indexOf(\"_field_\") != 0)\n/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n  #end\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (77, 'v4_dao', 'dao', NULL, '#if($table.tableName.indexOf(\"t_\") == 0)${context.javaBeanName.substring(1)}Dao.java#else${context.javaBeanName}Dao.java#end', 'package ${context.packageName}.dao;\n\nimport ${context.packageName}.dto.#if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end;\nimport org.apache.ibatis.annotations.Param;\nimport java.util.Collection;\n\n// ${(table.tableName.indexOf(\"t_\") == 0)?context.javaBeanName.substring(1):context.javaBeanName}\n// #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end\n\npublic interface #if($table.tableName.indexOf(\"t_\") == 0)${context.javaBeanName.substring(1)}Dao#else${context.javaBeanName}Dao#end {\n\n int save(@Param(value = \"entity\") #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end  ${context.javaBeanNameLF} );\n\n int saveSelective(@Param(value = \"entity\") #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end  ${context.javaBeanNameLF});\n\n int update(@Param(value = \"entity\")#if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end  ${context.javaBeanNameLF});\n\n int updateByPrimaryKeySelective(@Param(value = \"entity\") #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end ${context.javaBeanNameLF});\n\n ${context.javaBeanName} get(@Param(value = \"entity\") #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end  ${context.javaBeanNameLF});\n\n int del(@Param(value = \"entity\") #if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end  ${context.javaBeanNameLF});\n\n int saveBatch(@Param(value = \"entities\") Collection<#if($table.tableName.indexOf(\"t_\") == 0) ${context.javaBeanName.substring(1)}#else${context.javaBeanName}#end> ${context.javaBeanNameLF}s) ;\n\n}', 'admin');
INSERT INTO `template_config` VALUES (78, 'o2o_cashier_dao', 'dao', NULL, '${context.javaBeanName}Dao.java', 'package ${context.packageName}.dao;\n\nimport ${context.packageName}.dao.model.${context.javaBeanName};\nimport org.apache.ibatis.annotations.Param;\nimport java.util.Collection;\n\n\npublic interface ${context.javaBeanName}Dao {\n\n int save(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF} );\n\n int saveSelective(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF});\n\n int update(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF});\n\n int updateByPrimaryKeySelective(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF});\n\n ${context.javaBeanName} get(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF});\n\n int del(@Param(value = \"entity\") ${context.javaBeanName}  ${context.javaBeanNameLF});\n\n int saveBatch(@Param(value = \"entities\") Collection<${context.javaBeanName}> ${context.javaBeanNameLF}s) ;\n\n}', 'admin');
INSERT INTO `template_config` VALUES (79, 'o2o_cashier_model', 'dao/model', NULL, '${context.javaBeanName}.java', 'package ${context.packageName}.dao.model;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\nimport lombok.EqualsAndHashCode;\nimport lombok.ToString;\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"Date\")\nimport java.util.Date;\n#break\n#end\n#end\n#foreach($column in $columns)\n#if(${column.javaTypeBox} == \"BigDecimal\")\nimport java.math.BigDecimal;\n#break\n#end\n#end\n\nimport java.io.Serializable;\n\n@AllArgsConstructor\n@NoArgsConstructor\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = false)\n@Data\npublic class ${context.javaBeanName}  implements Serializable {\n\n#foreach($column in $columns)\n	/** ${column.comment} */\n	private ${column.javaTypeBox} ${column.javaFieldName};\n#end\n\n}', 'admin');
INSERT INTO `template_config` VALUES (80, 'o2o_cahier_mapper', 'dao/mapper', NULL, '${context.javaBeanName}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE  mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n    <resultMap id=\"queryResultMap\" type=\"${context.packageName}.dao.model.${context.javaBeanName}\">\n        #foreach($column in $columns)\n        <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n        #end\n    </resultMap>\n    \n	<sql id=\"Base_Column_List\" >\n        #foreach($column in $columns)             \n         #if(${velocityCount} > 1),#end ${column.columnName} \n        #end\n    </sql>\n    \n    \n    <insert id=\"save\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n    </insert>\n\n    <insert id=\"saveSelective\" \n#if(${pkColumn.isIdentity})\n    keyProperty=\"entity.${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n    >\n    INSERT INTO ${table.tableName}\n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              ${column.columnName},\n              </if>\n            #end          \n        #end\n        </trim>\n    VALUES \n         <trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")           \n            <if test=\"entity.${column.javaFieldName} != null\" >\n              #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n            </if>\n            #end          \n        #end\n        </trim>\n    </insert>\n\n    <update id=\"update\" >\n    UPDATE ${table.tableName}\n    SET \n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n    #set($i=$i+1)       \n     #end          \n        #end    \n    WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    <update id=\"updateByPrimaryKeySelective\" >\n        UPDATE ${table.tableName}\n        <set>\n            #foreach($column in $columns) \n                #if(!${column.isPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\") \n                <if test=\"entity.${column.javaFieldName} !=null\">\n                    ${column.columnName}=#{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}},\n                </if>\n                #end\n            #end\n        </set>\n        where ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </update>\n\n    \n    <select id=\"get\" resultMap=\"queryResultMap\">\n        SELECT <include refid=\"Base_Column_List\" />\n        FROM ${table.tableName} t\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </select>\n    \n\n    <delete id=\"del\">\n        DELETE FROM ${table.tableName}\n        WHERE ${context.pkName} = #{entity.${context.javaPkName},jdbcType=${context.mybatisPkType}}\n    </delete>\n\n	<insert id=\"saveBatch\">\n    	INSERT INTO ${table.tableName}\n         (\n #set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end ${column.columnName}\n#set($i=$i +1)\n            #end          \n        #end\n          )\n    VALUES \n    <foreach collection=\"entities\" index=\"index\" item=\"entity\" separator=\",\">\n    	(\n#set ($i=0) \n        #foreach($column in $columns) \n            #if(!${column.isIdentityPk} and ${column.columnName} != \"create_time\" and ${column.columnName} != \"update_time\")               \n        #if($i > 0),#end #{entity.${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n            #end          \n        #end\n \n        )\n        </foreach>\n	</insert>\n	\n</mapper>', 'admin');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
